<template>
	<view>
		<view>
			<uni-nav-bar shadow left-icon="left" dark title="供应商审核列表" @clickLeft="back()" />
		</view>
		<uni-row >
			<uni-col :span="8"><uni-easyinput class="uni-mt-5" suffixIcon="search" v-model="SupplierForm.supplierCode"  placeholder="供应商编号" @iconClick="iconClick"></uni-easyinput></uni-col>
			<uni-col :span="8"><uni-easyinput class="uni-mt-5" suffixIcon="search" v-model="SupplierForm.supplierName" placeholder="供应商名称" @iconClick="iconClick"></uni-easyinput></uni-col>
		    <uni-col :span="8">
		    <uni-data-select
		      v-model="SupplierForm.examineStatus"
		      :localdata="range"
		      @change="iconClick"
		    ></uni-data-select></uni-col>
		
		</uni-row>
		<view v-for="(item,index) in tableSupplier" :key="index">
			<uni-card>
			<uni-row >供应商编号:{{item.supplierCode}}</uni-row>
			<uni-row> 供应商名称:{{item.supplierName}}</uni-row>
			<uni-row> 联系人:{{item.contactPerson}}</uni-row>
			<uni-row> 联系电话:{{item.cellPhone}}</uni-row>
			<uni-row v-if="item.examineStatus=='0'" style="color:gold"> 审核状态:待审核</uni-row>
			<uni-row v-if="item.examineStatus=='1'" style="color:gold"> 审核状态:已通过</uni-row>
			<uni-row v-if="item.examineStatus=='2'" style="color:red"> 审核状态:未通过</uni-row>
			<uni-row v-if="item.examineStatus=='3'" style="color:gold"> 审核状态:注册待审核</uni-row>
			<uni-row v-if="item.examineStatus=='4'" style="color:gold"> 审核状态:修改待审核</uni-row>
			<uni-row v-if="item.examineStatus=='5'" style="color:gold"> 审核状态:信息不全</uni-row>
			<uni-row style="text-align: center;"><button type="primary" size="mini" @click="purchaser_list_detail(tableSupplier[index])">显示详细</button></uni-row>
			</uni-card>
		</view>
		
	</view>
</template>

<script>
	 import {examineSupplier} from '@/api/system/user'
	export default {
		data() {
			return {
				tableSupplier:[],
				SupplierForm:{
					page: 1,
					rows: 20,
					supplierCode:null,
					supplierName:null,
					examineStatus:3
                    // examineStatus:3,
				},
				range: [
					{"value": 6,"text": "所有"	},
					// {"value":0,"text": "待审核"	},
					{"value":1,"text": "已通过"},
					{"value":2,"text": "未通过"},
					{"value":3,"text": "注册待审核"},
					{"value":4,"text": "修改待审核"},
					{"value":5,"text": "信息不全"},
					], 
				
			}
		},
		onLoad() {
			this.get()
		},
		
		methods: {
			iconClick(){
				this.get()
			},
			get(){
			  examineSupplier(this.SupplierForm).then(res=>{
				
				  this.tableSupplier = res.rows
			  })
			},
			//返回上一层
			back(){
				this.$tab.reLaunch('/pages/work/purchaser/index')
			},
			//传递详细信息
			purchaser_list_detail(e){
				uni.navigateTo({
				       url: '/pages/work/purchaser/purchaser_list_register_detail',
				       success: (respost) => {
				           // 通过eventChannel向被打开页面传送数据
				           respost.eventChannel.emit('acceptDataFromOpenerPage', {data:e},
						   )}
				     });
			}
		}
	}
</script>

<style>

</style>
